<template>
	<view class="contract-box">
		<u-popup :show="data.isVisible" mode="bottom">
			<view class="popup">
				<view class="popup-title flex">
					<view class="cancle" @click="close"> 取消</view>
					<view class="title"> 更多 </view>
					<view class="sure"></view>
				</view>
				<view class="singe-box" style="margin: 0;padding: 0;">
					<scroll-view scroll-y="true" style="widht:100%;min-height: 200rpx; max-height: 600rpx;">
						<ul>
							<li class="singer-item" @click="onSelectChange('audit')"
								v-if="data.detail.audit_user_status == 1"> 变更审核人 </li>
							<li class="singer-item" @click="onSelectChange('sign')"
								v-if="data.detail.signer_user_status == 1"> 变更企业签署人 </li>
							<li class="singer-item" @click="onSelectChange('recipient')"
								v-if="data.detail.recipient_status == 1"> 变更抄送人 </li>
						</ul>
					</scroll-view>
				</view>
			</view>
		</u-popup>
	</view>
</template>
<script setup>
	import {
		reactive,
		ref
	} from "vue";
	import {
		defineEmits
	} from 'vue';
	const emit = defineEmits(['returnFun']);
	const data = reactive({
		isVisible: ref(false),
		changeVal: '',
		options: [{
			value: 'sign',
			text: '变更企业签署人'
		}, {
			value: 'audit',
			text: '变更审核人'
		}, {
			value: 'recipient',
			text: '变更抄送人'
		}, ],
		detail: {},
	});
	const close = () => {
		console.log(data.isVisible);
		data.isVisible = false;
	}
	const open = (item) => {
		data.detail = item;
		data.isVisible = true;
	}
	const onSelectChange = (item) => {
		emit('returnFun', {
			type: item,
			id: data.detail.member_contract_id,
		});
		data.isVisible = false;
	}
	defineExpose({
		open,
	});
	// export default {
	//   props: {
	//     options: {
	//       type: Array,
	//       required: true
	//     }
	//   },
	//   data() {
	//     return {
	//       isVisible: false,
	//       selected: ''
	//     };
	//   },
	//   methods: {
	//     openModal() {
	//       this.isVisible = true;
	//     },
	//     closeModal() {
	//       this.isVisible = false;
	//     },
	//     onSelectChange() {
	//       this.$emit('select', this.selected);
	//       this.closeModal();
	//     }
	//   }
	// };
</script>
<style scoped lang="scss" src="/static/css/contract/initiate.scss"></style>
<style scoped lang="scss">
	.popup {
		background: #fff !important;
	}

	.singer-item {
		width: 100% !important;
		text-align: center;
		border-top: 1rpx solid #eee;
		height: 100rpx !important;
		justify-content: center;
		color: rgba(0, 0, 0, 0.8);
	}
</style>